{% extends "base.html" %}
{# Page moderation des joueurs #}

{% block title %}{{ pageTitle}}{% endblock %}

{% block additionalHeaders %}
	<link rel="stylesheet" type="text/css" href="media/css/adm_style.css" />
	<script type="text/javascript" src="media/js/admin.js"></script>
{% endblock %}

{% block content %}
	<h1>{{ pageTitle }}{% if isAPlayer %} : {{player.getNickname()}}{% endif %}</h1>
	
	{%include 'displayErrors.html' %}

	{% if not isAPlayer %}
	<form action="" method="GET">
		<select name="pid">
			{% for player in players  %}
			<option value="{{player.getId()}}">{{player.getId()}} - {{player.getNickname()}}</option>
			{% endfor %}
		</select>
		<input type="submit" />
    </form>
	{% else %}
	<ul>
		<li>IP on registration: {{player.getIp()}}</li>
		<li>Registration date: {{player.getRegister_date()}}</li>
	</ul>
	<form action="" method="POST">
	{{crsfToken|raw}}
		<ul>
			<li><a href="profile.php?pid={{player.getId()}}" rel="shadowbox" title="{{player.getNickname()}}'s profile">See Profile</a></li>
			<li>Total of days banned: {{player.getDays_banned()}}</li>
			<li>
				<label>Is banned?</label>
				<div>
					{% if player.isBanned() %}
						YES, until {{player.getUnban_date()}} <input type="submit" name="submit" value="Unban" />
					{% else %}
						NO
					{% endif %}
					<div class="ban">
						BAN:
						<select name="bandays">
							<option value="0">{% if player.isBanned() %}add{% else %}select{% endif %} days</option>
							<option value="1">1 day</option>
							<option value="2">2 days</option>
							<option value="7">1 week</option>
							<option value="14">2 weeks</option>
							<option value="30">1 month</option>
							<option value="365000">100 years</option>
						</select>
						<input type="submit" name="submit" value="Ban" />
					</div>
				</div>
			</li>
		</ul>
    </form>
	{% endif %}
	

{% endblock content %}